Matthias Clasen [Mon, 27 Jul 2020 00:54:57 +0000 (20:54 -0400)]
docs: Fix up some issues in the a11y docs
Fix up syntax errors and links in the introductory
section about accessibility.
Matthias Clasen [Mon, 27 Jul 2020 00:30:36 +0000 (20:30 -0400)]
docs: Update a11y docs
Add some missing functions.
Emmanuele Bassi [Sun, 26 Jul 2020 19:56:54 +0000 (20:56 +0100)]
ci: Re-enable the accessibility test suite
Now that we have something that is both reliable and local.
Emmanuele Bassi [Sun, 26 Jul 2020 19:30:35 +0000 (20:30 +0100)]
a11y: Add a simple test case for GtkButton's accessible state
Emmanuele Bassi [Sun, 26 Jul 2020 19:29:00 +0000 (20:29 +0100)]
a11y: Simplify the test API
We don't need as many functions to print out the property, relation, and
state of an accessible. Additionally, we should allow comparing the
accessible attributes with an expected value, and print out the real
accessible value if they do not match.
Emmanuele Bassi [Sun, 26 Jul 2020 19:27:39 +0000 (20:27 +0100)]
a11y: Allow setting the role post-construction
Some widgets have different roles after they are constructed, so we need
to allow changing the role defined by the class. We should still avoid
setting a role after the GtkATContext has been created.
Emmanuele Bassi [Sun, 26 Jul 2020 14:50:55 +0000 (15:50 +0100)]
a11y: Add API to retrieve accessible values
We are going to use this for implementing ATContext subclasses, but also
in the testing API.
Emmanuele Bassi [Wed, 22 Jul 2020 15:32:09 +0000 (16:32 +0100)]
a11y: Add more test API
Emmanuele Bassi [Wed, 22 Jul 2020 15:31:44 +0000 (16:31 +0100)]
a11y: Restart the accessibility test suite
Emmanuele Bassi [Wed, 22 Jul 2020 12:48:00 +0000 (13:48 +0100)]
Fix build with debugging notes disabled
Matthias Clasen [Fri, 17 Jul 2020 19:51:28 +0000 (15:51 -0400)]
a11y: Update GtkCheckButton
This is a bit unfortunate, since the aria modelling
doesn't quite agree with ours, so we have to listen
for the togglebutton property change, and we inherit
the pressed state from the togglebutton accessible.
Matthias Clasen [Fri, 17 Jul 2020 18:41:06 +0000 (14:41 -0400)]
a11y: Update GtkSpinButton
Set the appropriate accessible role, and update
the value properties.
Matthias Clasen [Fri, 17 Jul 2020 17:10:18 +0000 (13:10 -0400)]
a11y: Update GtkProgressBar
Update state and properties as appropriate.
Matthias Clasen [Fri, 17 Jul 2020 16:42:24 +0000 (12:42 -0400)]
testatcontext: Print role nicks
This makes for easier reading.
Emmanuele Bassi [Wed, 22 Jul 2020 12:11:28 +0000 (13:11 +0100)]
a11y: Update labelled-by when setting mnemonic labels
The ARIA labelled-by attribute behaves the same way as the mnemonic
labels in GTK.
Emmanuele Bassi [Wed, 22 Jul 2020 12:08:20 +0000 (13:08 +0100)]
a11y: Change the collection type for reflist attributes
Emmanuele Bassi [Wed, 22 Jul 2020 12:07:36 +0000 (13:07 +0100)]
a11y: Allow storing list of references in GtkAccessibleValue
It's one of the fundamental accessible value types in ARIA.
Emmanuele Bassi [Fri, 17 Jul 2020 16:43:01 +0000 (17:43 +0100)]
a11y: Change default accessible role
Only GtkWidget should use GTK_ACCESSIBLE_ROLE_WIDGET as its default
accessible role; the default for GtkAccessible and GtkATContext should
be GTK_ACCESSIBLE_ROLE_NONE, meaning "an element whose implicit native
role semantics will not be mapped to the accessibility API", according
to the WAI-ARIA specification.
Matthias Clasen [Fri, 17 Jul 2020 14:40:31 +0000 (10:40 -0400)]
inspector: Support the a11y debug flag
Add support for the GTK_DEBUG_A11Y debug flag in
the logs tab.
Matthias Clasen [Fri, 17 Jul 2020 14:36:43 +0000 (10:36 -0400)]
testatcontext: Use the new debug flag
Only dump a11y state if GTK_DEBUG=accessibility is set.
Matthias Clasen [Fri, 17 Jul 2020 14:36:20 +0000 (10:36 -0400)]
Add GTK_DEBUG=accessibility
Add a debug flag for accessibility-related debug spew.
Emmanuele Bassi [Fri, 17 Jul 2020 13:39:56 +0000 (14:39 +0100)]
a11y: Add testing API
We want to test the accessibility API, as well as the implementation
inside each widget. For that, we should expose an API that lets us
verify that a GtkAccessible has a given role, as well as a given
property.
The API follows the pattern of other GTest API:
- a macro to assert that a condition is respected
- a function that prints out the error message in case of failure
Emmanuele Bassi [Fri, 17 Jul 2020 13:31:02 +0000 (14:31 +0100)]
a11y: Implement role and state change in GtkSwitch
Set the "switch" role, and update the "checked" state when the :active
property is toggled.
Emmanuele Bassi [Fri, 17 Jul 2020 11:49:59 +0000 (12:49 +0100)]
a11y: Consolidate the attributes container
While we have split the various attributes for convenience, there's no
reason why we should have specialised data types for the attributes
container object.
Emmanuele Bassi [Fri, 17 Jul 2020 11:00:31 +0000 (12:00 +0100)]
a11y: Add relations API
Since we split relation attributes from the generic properties, we need
to add API for setting and retrieving their values.
Emmanuele Bassi [Thu, 16 Jul 2020 17:08:22 +0000 (18:08 +0100)]
a11y: Simplify GtkAccessibleValue
Reduce the amount of subclassing, by handling collection of fundamental
types directly from the generic code paths. We now handle boolean,
tristate, integer, number, string, and relation values in the generic
code path; if an attribute supports the "undefined" value, we return the
undefined value singleton.
Emmanuele Bassi [Wed, 15 Jul 2020 18:08:37 +0000 (19:08 +0100)]
a11y: Resync with the ARIA spec
Drop roles and properties that were deprecated in WAI-ARIA 1.1, and add
new roles and properties defined in WAI-ARIA 1.2 and later.
We also split the relationship properties into their own enumeration, so
we can keep the GtkAccessibleProperty type more compact.
Emmanuele Bassi [Wed, 15 Jul 2020 12:20:38 +0000 (13:20 +0100)]
Remove GTK_ACCESSIBLE_STATE_NONE
It's pointless, we can use an explicit value of `-1` everywhere.
Additionally, it complicates all code that uses the state enumeration as
an array index, since now we need to guard against a negative offset.
Emmanuele Bassi [Mon, 13 Jul 2020 16:47:36 +0000 (17:47 +0100)]
a11y: Add binding-friendly accessible property setter
Matching the one for the accessible state.
Emmanuele Bassi [Mon, 13 Jul 2020 16:43:06 +0000 (17:43 +0100)]
a11y: Collect reference value
Some properties that take a reference to an accessible haven't been
updated to collect the correct type.
Emmanuele Bassi [Mon, 13 Jul 2020 16:04:38 +0000 (17:04 +0100)]
a11y: Update the accessible label for GtkButton
Emmanuele Bassi [Mon, 13 Jul 2020 15:26:24 +0000 (16:26 +0100)]
a11y: Update GtkSeparator
Add an accessible role, and update the orientation state.
Emmanuele Bassi [Mon, 13 Jul 2020 15:22:44 +0000 (16:22 +0100)]
a11y: Set the role for GtkScale
Emmanuele Bassi [Mon, 13 Jul 2020 15:22:22 +0000 (16:22 +0100)]
a11y: Update the accessible state for GtkRange
Emmanuele Bassi [Mon, 13 Jul 2020 15:10:36 +0000 (16:10 +0100)]
a11y: Update the "pressed" state on toggle buttons
Emmanuele Bassi [Mon, 13 Jul 2020 15:03:27 +0000 (16:03 +0100)]
a11y: Add roles to various widgets
Emmanuele Bassi [Mon, 13 Jul 2020 14:51:39 +0000 (15:51 +0100)]
Add accessible properties to GtkAccessible
We propagate the accessible state and properties to each ATContext in
the same virtual function, since they are functionally similar.
Emmanuele Bassi [Sun, 12 Jul 2020 19:07:57 +0000 (20:07 +0100)]
Add GtkAccessiblePropertySet
Like GtkAccessibleStateSet, the PropertySet is a set for accessible
properties.
Emmanuele Bassi [Mon, 13 Jul 2020 14:22:24 +0000 (15:22 +0100)]
Plumb all the GtkAccessibleProperty values into GtkAccessibleValue
Similarly to how we deal with GtkAccessibleState.
Emmanuele Bassi [Mon, 13 Jul 2020 14:20:19 +0000 (15:20 +0100)]
Allow setting the accessible role at construction
Some widgets have different accessible roles depending on some
parameter, so we cannot set the role at class init time. For those
widgets, we add an "accessible-role" property to GtkAccessible, and we
allow setting it (only) at construction time.
Emmanuele Bassi [Wed, 8 Jul 2020 13:42:32 +0000 (14:42 +0100)]
Start documenting the Accessibility API
Add the introductory text from #2833, and the various types to the API
reference.
Emmanuele Bassi [Tue, 7 Jul 2020 16:51:01 +0000 (17:51 +0100)]
Update the accessible state on widget visibility changes
The GTK_ACCESSIBLE_STATE_HIDDEN has the opposite meaning of the
GtkWidget:visible property.
Emmanuele Bassi [Wed, 8 Jul 2020 15:58:11 +0000 (16:58 +0100)]
Have GtkWidget implement GtkAccessible
Each widget type has an accessible role associated to its class, as
roles cannot change during the life time of a widget instance.
Each widget is also responsible for creating an ATContext, to proxy
state changes to the underlying accessibility infrastructure.
Emmanuele Bassi [Wed, 8 Jul 2020 15:56:31 +0000 (16:56 +0100)]
Plug GtkATContext into GtkAccessible
An Accessible implementation must create an ATContext object. UI
elements are supposed to interact with the GtkAccessible API, but we
expose GtkATContext to allow patterns like delegation.
Emmanuele Bassi [Wed, 8 Jul 2020 15:51:57 +0000 (16:51 +0100)]
Add GtkATContext
The ATContext type is meant to be used as the base class for
implementations of the assistive technology API—the actual mechanism
needed to communicate to components like the screen reader, or any other
AT.
Every time the widget state changes, the ATContext is meant to broadcast
the state change; and every time the AT queries the state of a UI
element, the ATContext is meant to provide that information.
We also have a "test" ATContext implementation, which is meant to be
used to write tests to verify that changes are propagated without
requiring a whole desktop session.
Emmanuele Bassi [Wed, 8 Jul 2020 15:45:57 +0000 (16:45 +0100)]
Add GtkAccessibleStateSet
Since states can be set or unset, we need a container type that has all
the possible states, and a bitmask that tells us which ones are set.
Emmanuele Bassi [Wed, 8 Jul 2020 15:34:32 +0000 (16:34 +0100)]
Add GtkAccessibleValue
All accessible properties and states may have one of the following
types:
- true/false
- true/false/undefined
- true/false/mixed/undefined
- reference (to another UI element)
- reference list
- integer
- number (real numerical value)
- string
- token (one of a limited set of allowed values)
- token list
See: https://www.w3.org/WAI/PF/aria/states_and_properties#propcharacteristic_value
The GtkAccessibleValue is a simple reference counted type that can be
"subclassed" to implement each value type.
This initial commit adds GtkAccessibleValue and the basic subclasses for
plain boolean, tristate (true/false/undefined), and token types,
including statically allocated values that can be shared instead of
allocated.
Emmanuele Bassi [Tue, 16 Jun 2020 16:40:14 +0000 (17:40 +0100)]
Introduce GtkAccessible
GtkAccessible is an interface for accessible UI elements.
Currently, it doesn't do much except exist as a type; in the future, it
will be the entry point for all accessible state in GTK.
Emmanuele Bassi [Tue, 16 Jun 2020 16:04:05 +0000 (17:04 +0100)]
a11y: Add the supported accessibility roles
The list of roles is taken from the WAI-ARIA 1.2 specification:
https://w3c.github.io/aria/
Some of these roles do not make entirely sense from a GTK application
perspective, but we can remove them before finalizing the API.
Emmanuele Bassi [Tue, 16 Jun 2020 15:41:59 +0000 (16:41 +0100)]
Remove ATK
To build a better world sometimes means having to tear the old one down.
-- Alexander Pierce, "Captain America: The Winter Soldier"
ATK served us well for nearly 20 years, but the world has changed, and
GTK has changed with it. Now ATK is mostly a hindrance towards improving
the accessibility stack:
- it maps to a very specific implementation, AT-SPI, which is Linux and
Unix specific
- it requires implementing the same functionality in three different
layers of the stack: AT-SPI, ATK, and GTK
- only GTK uses it; every other Linux and Unix toolkit and application
talks to AT-SPI directly, including assistive technologies
Sadly, we cannot incrementally port GTK to a new accessibility stack;
since ATK insulates us entirely from the underlying implementation, we
cannot replace it piecemeal. Instead, we're going to remove everything
and then incrementally build on a clean slate:
- add an "accessible" interface, implemented by GTK objects directly,
which describe the accessible role and state changes for every UI
element
- add an "assistive technology context" to proxy a native accessibility
API, and assign it to every widget
- implement the AT context depending on the platform
For more information, see: https://gitlab.gnome.org/GNOME/gtk/-/issues/2833
Benjamin Otte [Sun, 26 Jul 2020 19:24:25 +0000 (19:24 +0000)]
Merge branch 'wip/otte/boolfilter' into 'master'
Add GtkBoolFilter
See merge request GNOME/gtk!2288
Jordi Mas [Sun, 26 Jul 2020 19:13:16 +0000 (21:13 +0200)]
Update Catalan translation
Benjamin Otte [Sun, 26 Jul 2020 15:55:54 +0000 (17:55 +0200)]
Add GtkBoolFilter
Takes a boolean GtkExpression (like a boolean object property) to run a
filter with.
Matthias Clasen [Sun, 26 Jul 2020 12:00:49 +0000 (12:00 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
overlaylayout: Document minimally
See merge request GNOME/gtk!2285
Matthias Clasen [Sat, 25 Jul 2020 23:02:33 +0000 (19:02 -0400)]
overlaylayout: Document minimally
This layout manager is not reusable, but we
still need to make its layout properties show
up in the docs.
Matthias Clasen [Sat, 25 Jul 2020 17:30:11 +0000 (17:30 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2284
Matthias Clasen [Sat, 25 Jul 2020 02:57:34 +0000 (22:57 -0400)]
gtk: Improve struct packing in places
Plug some holes in our structs by rearranging
a few fields. This is was done looking at
pahole output.
Matthias Clasen [Sat, 25 Jul 2020 02:57:00 +0000 (22:57 -0400)]
gdk: Improve struct packing in places
Plug some holes in our structs by rearranging
a few fields. This is was done looking at
pahole output.
Matthias Clasen [Sat, 25 Jul 2020 04:31:08 +0000 (00:31 -0400)]
colorswatch: Remove unused radius fields
The radius fields are never used.
Matthias Clasen [Sat, 25 Jul 2020 04:29:42 +0000 (00:29 -0400)]
hsla: Just store floats
We are using floats for rgb, and we don't need more precision
for hsl colors either. We use hsl for computing color expressions
like shade(), lighter() and darker(), which are not precisely
specified anyway.
This commit updates the one test where the output changes a
tiny bit due to this.
Matthias Clasen [Sat, 25 Jul 2020 11:40:24 +0000 (07:40 -0400)]
headerbar: Drop the Private struct
Matthias Clasen [Sat, 25 Jul 2020 02:56:24 +0000 (22:56 -0400)]
colorplane: Drop the Private struct and padding
Matthias Clasen [Sat, 25 Jul 2020 00:05:28 +0000 (00:05 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2283
Matthias Clasen [Fri, 24 Jul 2020 23:54:01 +0000 (23:54 +0000)]
Merge branch 'wip/otte/types' into 'master'
Get rid of unneeded glib types
See merge request GNOME/gtk!2282
Matthias Clasen [Fri, 24 Jul 2020 23:28:21 +0000 (19:28 -0400)]
Add another sortlistmodel test
This tests the crash fix in
f7b73b2e010960975.
Matthias Clasen [Fri, 24 Jul 2020 22:32:01 +0000 (18:32 -0400)]
testsuite: Add an incremental sort test
Add a test that makes changes to a model while it
is incrementally sorted.
Matthias Clasen [Fri, 24 Jul 2020 23:22:12 +0000 (19:22 -0400)]
timsort: Avoid a crash
We need to clear the pointer after freeing the data,
since the sortlistmodel keeps its timsort structure
around and reuses it.
Benjamin Otte [Fri, 24 Jul 2020 20:32:16 +0000 (22:32 +0200)]
Replace "gdouble" with "double"
Benjamin Otte [Fri, 24 Jul 2020 20:25:56 +0000 (22:25 +0200)]
Replace "gfloat" with "float"
Benjamin Otte [Fri, 24 Jul 2020 18:40:36 +0000 (20:40 +0200)]
Replace "gchar" with "char"
Benjamin Otte [Fri, 24 Jul 2020 13:54:49 +0000 (15:54 +0200)]
Replace "gint" with "int"
Matthias Clasen [Fri, 24 Jul 2020 19:37:49 +0000 (15:37 -0400)]
testsuite: Use better names for sortlistmodel tests
Name the tests for what they do.
Matthias Clasen [Fri, 24 Jul 2020 19:22:14 +0000 (15:22 -0400)]
testsuite: Reenable tests for incremental sort
This was unintentionally disabled.
Matthias Clasen [Fri, 24 Jul 2020 18:17:30 +0000 (18:17 +0000)]
Merge branch 'remove-align-widget' into 'master'
menubutton: Remove align-widget property
See merge request GNOME/gtk!2280
Matthias Clasen [Fri, 24 Jul 2020 14:40:55 +0000 (10:40 -0400)]
sortlistmodel: Fix a crash
Matthias Clasen [Fri, 24 Jul 2020 13:07:45 +0000 (09:07 -0400)]
dropdown: Fix popup sizing
Setting a width request is not quite enough, since
gtk_widget_set_size_request() only queues a resize
when the widget is visible. Explicitly force one
here. Without this, the popup sometimes shows up
too small.
Florian Müllner [Fri, 24 Jul 2020 11:39:38 +0000 (13:39 +0200)]
menubutton: Remove align-widget property
The property has been unused since commit
8701e34f749. That was four
years ago, so it's safe to say that nobody has been missing it terribly.
Timm Bäder [Fri, 24 Jul 2020 09:28:21 +0000 (09:28 +0000)]
Merge branch 'fix-gdk-array-msvc' into 'master'
gdk/gdkarrayimpl.c: Fix build on Visual Studio
See merge request GNOME/gtk!2279
Chun-wei Fan [Fri, 24 Jul 2020 08:25:24 +0000 (16:25 +0800)]
gdk/gdkarrayimpl.c: Fix build on Visual Studio
It seems like initializing something to an empty array using `{}` is a GCCism,
so just stuff a 0 within the braces to accomplish the same thing.
Matthias Clasen [Fri, 24 Jul 2020 02:58:51 +0000 (02:58 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
filechooser: Remove a leftover signal emission
Closes #2942
See merge request GNOME/gtk!2276
Matthias Clasen [Thu, 23 Jul 2020 20:14:33 +0000 (16:14 -0400)]
docs: Work around escaping bugs
This is truly a russian doll of documentation formats:
a string containing <> inside an xml fragment in an |[ ]|
gtk-doc example in markdown in a doc comment.
Sadly, something gets escaping wrong, so the <> end up
literally in the docbook and mess up the last step of
our document formatting, even after turning them into
entities.
Work around this with an extra level of entities that
really shouldn't be necessary.
Matthias Clasen [Thu, 23 Jul 2020 19:46:06 +0000 (15:46 -0400)]
docs: Pass --standalone to pandoc
This flag causes pandoc to emit a proper doctype
declaration and, crucially, namespace declarations
for the xlink namespace that it insists on using
for href attributes. Without this, putting external
links in md documents doesn't survive the journey
through xml.
Matthias Clasen [Thu, 23 Jul 2020 16:57:08 +0000 (12:57 -0400)]
docs: Improve shortcut trigger docs
Point out the need to escape <> in xml.
Matthias Clasen [Thu, 23 Jul 2020 16:43:46 +0000 (12:43 -0400)]
docs: Explain the shortcutcontroller example a bit
Add a reference to the the syntax for shortcut actions
in builder files.
Matthias Clasen [Thu, 23 Jul 2020 11:58:57 +0000 (07:58 -0400)]
filechooser: Remove a leftover signal emission
Commit
0145809a94667c75ed4a4 replace the response-requested
signal with an action, but didn't actually remove the emission
of that no-longer-existing signal.
Fixes: #2942
Benjamin Otte [Thu, 23 Jul 2020 14:34:33 +0000 (14:34 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
Wip/otte/for master
See merge request GNOME/gtk!2277
Benjamin Otte [Thu, 23 Jul 2020 01:35:26 +0000 (03:35 +0200)]
searchenginemodel: Remove unused code
Benjamin Otte [Thu, 23 Jul 2020 01:06:42 +0000 (03:06 +0200)]
searchengine: Remove unused set_recursive() call
Florentina Mușat [Thu, 23 Jul 2020 10:33:16 +0000 (10:33 +0000)]
Update Romanian translation
Florentina Mușat [Thu, 23 Jul 2020 10:32:08 +0000 (10:32 +0000)]
Update Romanian translation
Matthias Clasen [Thu, 23 Jul 2020 00:19:15 +0000 (00:19 +0000)]
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master
See merge request GNOME/gtk!2275
Matthias Clasen [Wed, 22 Jul 2020 23:51:27 +0000 (19:51 -0400)]
NEWS: Updates
Matthias Clasen [Wed, 22 Jul 2020 23:38:58 +0000 (19:38 -0400)]
migration guide: Add some tables
Add a table mapping event signals to their event controller
replacements, and a table mapping former GtkContainer
subclasses to their gtk_container_add replacement.
Benjamin Otte [Wed, 22 Jul 2020 18:08:24 +0000 (18:08 +0000)]
Merge branch 'wip/otte/for-master' into 'master'
timsort: Actually 0-terminate the array in get_runs()
See merge request GNOME/gtk!2274
Benjamin Otte [Wed, 22 Jul 2020 16:59:22 +0000 (18:59 +0200)]
timsort: Actually 0-terminate the array in get_runs()
This could cause SEGVs when changing the sort during an ongoing sort
operation.
Yuri Chornoivan [Wed, 22 Jul 2020 13:27:26 +0000 (13:27 +0000)]
Update Ukrainian translation
Yuri Chornoivan [Wed, 22 Jul 2020 13:22:09 +0000 (13:22 +0000)]
Update Ukrainian translation
Matthias Clasen [Wed, 22 Jul 2020 13:15:45 +0000 (13:15 +0000)]
Merge branch 'wip/otte/sortlistmodel2' into 'master'
Massively refactor and improve sortlistmodel
See merge request GNOME/gtk!2273
Piotr Drąg [Wed, 22 Jul 2020 13:01:05 +0000 (15:01 +0200)]
Update POTFILES.in
Benjamin Otte [Wed, 22 Jul 2020 01:18:33 +0000 (03:18 +0200)]
gtk-demo: Add a progress bar when the colors demo resorts